<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="it.polimi.travelDream.ejb.servlet.*" %>
<%@page import="it.polimi.travelDream.entities.User" %>
    
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		  	TravelDreamLogin
		</title>
		<link rel="stylesheet" type="text/css" href="style.css" />
  	</head>
  
  
  <body>
  	<div class="header">
  		 <ul>
  			<li>TravelDream</li>
		    User Login
	    </ul>
  	</div> 	
  	
  	  	<div class="section">	    
	    <div class="nav">	    
		   	<ul>
		   		<li class="cur"> Login</li>
		   		<li> <a href="Registration.jsp"> Registration </a></li>
	    	</ul>
	    </div>
	    <div class="content">
	    
<% 
// L'utente loggato
User curr_u = (User) request.getSession().getAttribute("user");
%>





    			



<% if (curr_u == null) { %>

				<form action="LoginServlet" method="POST" id=form class=myform>
	    			<div class="spacer"></div>
	    			<fieldset>
	  					<legend>Login:</legend>
	  						
	  						<div class="spacer"></div>
	  						
	  						<label>Username
								<span class="small">Your username</span>
							</label>
							<input type="text" name="username"/>
							
							<label>Password
								<span class="small">Your registration Password</span>
							</label>
							<input type="password" name="password"/>

							
							<input class=button type="submit" name="submit" value="Login"/>

					</fieldset>
					
					   <% 
	    	if (request.getAttribute("message") == null) 
		    	{ 
		    		%>
						<div></div>
					<% 
				} 
	    	else 
		    	{ 
		    		%>
						<div class="advice"><%=request.getAttribute("message")%></div>
					<% 
				} 
		%>
					
					
					
				</form>
<% } %>
		</div>
 	</div>
    
    
    
    <div class="footer">
    	<ul>
	    	<li>TravelDream Company srl © All rights reserved</li>
		    <li>Terms of use | Contacts | Team </li>
	    </ul>
    </div>  
    
  </body>
</html>